import minRequest from '@/utils/request'

// 检查是否可以回库
export function imsStockOutWorkList(query) {
  return minRequest.get('/ims_data/imsStockOutWork/list', query)
}

// 清空托盘
export function clearPalletCodeSku(ids) {
  return minRequest.delete(`/ims/palletCodeSku/${ids}`)
}

// 查询回库列表
export function storageLocationDetails(query) {
  return minRequest.post('/workOrder/workOrder/storageLocationDetails', query)
}

// 出库完成
export function completedOutOrder(query) {
  return minRequest.post('/imsWorkOrder/outOrder/completedOutOrder', query)
}

// 回库
export function toStorageLocation(query) {
  return minRequest.post('/workOrder/workOrder/toStorageLocation', query)
}

// 拣货完成
export function finishOutWorkPick(query) {
  return minRequest.post('/ims_data/imsStockOutWork/finishOutWorkPick', query)
}

// 校验出库单号是否重复
export function checkSkuIsStandard(query) {
  return minRequest.post('/ims/palletCodeSku/checkSkuIsStandard', query)
}

// 查询出库任务
export function imsStockOutWork(query) {
  return minRequest.get('/ims_data/imsStockOutWork/list', query)
}

// 查询历史出库任务
export function imsStockOutWorkHistory(query) {
  return minRequest.get('/ims_data/imsStockOutWorkHistory/list1', query)
}

// 查询参数列表
export function listConfig(query) {
  return minRequest.get('/system/config/list', query)
}

// 出库单确认出库
export function verifyOutOrder(data) {
  return minRequest.post('/imsWorkOrder/outOrder/verifyOutOrder', data)
}

// 修改出库单管理
export function updateOutOrder(data) {
  return minRequest.put('/imsWorkOrder/outOrder', data)
}

// 查询出库单管理历史详细
export function getOutOrderHistory(outOrderId) {
  return minRequest.get('/imsWorkOrder/outOrder/history/' + outOrderId)
}

// 查询出库单管理详细
export function getOutOrder(outOrderId) {
  return minRequest.get('/imsWorkOrder/outOrder/' + outOrderId)
}

// 整出
export async function getWholeOutStock(skuId) {
  return minRequest.get(`/ims_data/imsStock/getWholeOutStock/${skuId}`)
}

// 零出
export async function getNotWholeOutStock(skuId) {
  return minRequest.get(`/ims_data/imsStock/getNotWholeOutStock/${skuId}`)
}

// 新增出库单
export async function AddOutOrder(params) {
  return minRequest.post(`/imsWorkOrder/outOrder`, params)
}

// 查询历史出库单列表
export async function outWorkHistory(data) {
  return minRequest.get('/imsWorkOrder/outOrder/list/history', data)
}

// 查询出库单管理列表
export async function listOutOrder(params) {
  return minRequest.get(`/imsWorkOrder/outOrder/list`, params, { noFormHasValue: false })
}
